package com.wxw.BaseLibrary.component;

import lombok.*;

public enum DataGridColumnType {
    ViewAgentCell(0, "ViewAgent"),
    TextViewCell(1, "TextView"),
    CheckBoxCell(2, "CheckBox")
    ;
    @Getter
    @Setter
    private int id;
    @Getter
    @Setter
    private String label;

    private DataGridColumnType(int id, String label) {
        this.id = id;
        this.label = label;
    }

    public static DataGridColumnType getColumnType(int id) {
        for (DataGridColumnType type : DataGridColumnType.values()) {
            if (type.getId() == id) {
                return type;
            }
        }
        return null;
    }

    public static String getLabel(int id) {
        DataGridColumnType type = getColumnType(id);
        if (type != null) {
            return type.getLabel();
        }
        return null;
    }
}
